/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.io.Serializable;

/**
 *
 * @author Thai Ha Cong
 */

public class Orderitem implements Serializable {
    private int orderQuantity;
    private double orderPrice;
    private Product product;
    private Order order;

    public Orderitem() {
    }

    public Orderitem(int orderQuantity, double orderPrice, Product product) {
        this.orderQuantity = orderQuantity;
        this.orderPrice = orderPrice;
        this.product = product;
    }

    public Orderitem(int orderQuantity, double orderPrice, Product product, Order order) {
        this.orderQuantity = orderQuantity;
        this.orderPrice = orderPrice;
        this.product = product;
        this.order = order;
    }

    public int getOrderQuantity() {
        return orderQuantity;
    }

    public void setOrderQuantity(int orderQuantity) {
        this.orderQuantity = orderQuantity;
    }

    public double getOrderPrice() {
        return orderPrice;
    }

    public void setOrderPrice(double orderPrice) {
        this.orderPrice = orderPrice;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public Order getOrder() {
        return order;
    }

    public void setOrder(Order order) {
        this.order = order;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 79 * hash + (this.product != null ? this.product.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Orderitem other = (Orderitem) obj;
        if (this.product != other.product && (this.product == null || !this.product.equals(other.product))) {
            return false;
        }
        return true;
    }
    
}
